weiXinController.controller('operationRecordCtl',['$scope','$state','$stateParams','$timeout','$interval','$compile','$rootScope','$filter',function($scope,$state,$stateParams,$timeout,$interval,$compile,$rootScope,$filter) {
	console.log({name:$state.current.name,templateUrl:$state.current.templateUrl});
	
	/**
	 * 查询初始化
	 */
	var postData = {};
	var param = {
		id : 'tableDemo',
		checkbox : false,
		column : [
			{
				type:'rowNum',
				title:'编号',
                titleTdStyle: 'width: 60px;text-align: center;',
                dataTdStyle: 'width: 60px;text-align: center;'
			},{
				type:'key',
				mapping:'id',
				show:false
			},{
				mapping:'package_name',
				title:'包名',
				show:false
			},{
				mapping:'class_name',
				title:'类名',
				show:false
			},{
				mapping:'method_name',
				title:'方法名',
				show:false
			},{
				mapping:'method_content',
				title:'方法参数',
				show:false
			},{
				mapping:'gmt_modified',
				title:'时间',
                titleTdStyle: 'width: 180px;',
                dataTdStyle: 'width: 180px;'
			},{
				mapping:'gmt_des',
				title:'操作记录'
			}
		],
		page:function(cmd, currentPage, pageSize, totalPageNum){
			if('first' === cmd){
				currentPage = 1;
			}else if('prev' === cmd){
				currentPage--;
			}else if('next' === cmd){
				currentPage++;
			}else if('last' === cmd){
				currentPage = totalPageNum;
			}else if('change' === cmd){
				currentPage = 1;
			}
			$scope.search(currentPage,pageSize);
		}
	};
	EdeyeAdmin.initDataTable(param, {data:[]});
	
	/**
	 * 搜索
	 */
	$scope.search = function(currentPage, pageSize){
		postData.currentPage = (currentPage === undefined ? 1 : currentPage);
		postData.pageSize = (pageSize === undefined ? EdeyeAdmin.getPageSize(param.id) : pageSize);
		EdeyeAdmin.post({
			url:'/log/page',
			data:postData
		},{
			SUCCESS:function(ret){
				if(ret.code === '200'){
					EdeyeAdmin.setDataTableData(param, ret.data);
				}
			}
		});
	}
	
	$scope.search();
}]);